﻿create table MedicalAppointment(
  MedicalAppointmentID int IDENTITY(1,1) not null ,
  MeetingDatetime nchar(20) ,
  ReserveType int,
  PersonRef int ,
PRIMARY KEY (MedicalAppointmentID)
)

--<< FOREIGNKEYS DEFINITION >>--
If not Exists (select 1 from sys.objects where name = 'FK_MedicalAppointment_PersonRef')
	ALTER TABLE [MedicalAppointment]  ADD  CONSTRAINT [FK_MedicalAppointment_PersonRef] FOREIGN KEY([PersonRef])
	REFERENCES [Person] ([PersonID])
GO	
If not Exists (select 1 from sys.objects where name = 'FK_MedicalAppointment_ReserveTypeRef')
	ALTER TABLE [MedicalAppointment]  ADD  CONSTRAINT [FK_MedicalAppointment_ReserveTypeRef] FOREIGN KEY([ReserveType])
	REFERENCES [ReserveType] ([ReserveTypeID])
GO	